package com.live.shop.model;

import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.VideoView;

import org.json.JSONObject;

import java.io.Serializable;

public class ProductMaterialRecordModel  implements Serializable {
    int id;
    int productGroupId;//产品组ID
    String materialName;//素材名称
    int materialType;//素材类型 0.图片 1.视频 2.文字
    String materialFilepath;//素材文件真实路径
    String materialFileuri;//素材文件Uri路径
    int locationX;//位置X坐标移动值
    int locationY;//位置Y坐标移动值
    int scaleRate;//缩放率 1-200
    int hideState;//隐藏状态 0 显示 1隐藏
    int materialShowState;//素材展示时间状态[确保隐藏状态为 0显示，否则不生效]  0长时间（将按照设置的展示时间） 1自义定  2跟随关键词回复时间（必须设置关键词）
    int materialKeyShowtime;//素材关键词触发后展示时间自定义（秒）
    String keyword;//关键词
    String answerTxt;//回答文本
    int answerType;//合成方式 0.暂无 1.录音 2.AI合成 3.本地音频
    int answerState;//合成状态 0.暂无 1.已录音 2.已合成 3.已选择
    String answerAudio;//回答音频
    String createTime;//创建时间
    int deleteStatus;//删除状态 1新增 2编辑 3删除

    boolean viewStatus;
    //图片
    ImageView imageView;
    //视频
    VideoView videoView;

    public ProductMaterialRecordModel(){

    }
    public ProductMaterialRecordModel(boolean isAdd) {
        if(isAdd){
            this.materialName = "";
            this.materialType = 0;
            this.materialFilepath = "";
            this.materialFileuri = "";
            this.locationX = 0;
            this.locationY = 0;
            this.scaleRate = 100;
            this.hideState = 0;
            this.materialShowState = 0;
            this.materialKeyShowtime = 0;
            this.keyword = "";
            this.answerTxt = "";
            this.answerType = 0;
            this.answerState = 0;
            this.answerAudio = "";
            this.deleteStatus = 1;
        }
    }

    public JSONObject model2Json(ProductMaterialRecordModel model){
        JSONObject json = new JSONObject();
        try {
            json.put("id",model.getId());
            json.put("productGroupId",model.getProductGroupId());
            json.put("materialName",model.getMaterialName());
            json.put("materialType",model.getMaterialType());
            json.put("materialFilepath",model.getMaterialFilepath());
            json.put("materialFileuri",model.getMaterialFileuri());
            json.put("locationX",model.getLocationX());
            json.put("locationY",model.getLocationY());
            json.put("scaleRate",model.getScaleRate());
            json.put("hideState",model.getHideState());
            json.put("materialShowState",model.getMaterialShowState());
            json.put("materialKeyShowtime",model.getMaterialKeyShowtime());
            json.put("keyword",model.getKeyword());
            json.put("answerTxt",model.getAnswerTxt());
            json.put("answerType",model.getAnswerType());
            json.put("answerState",model.getAnswerState());
            json.put("answerAudio",model.getAnswerAudio());
            json.put("createTime",model.getCreateTime());
        }catch (Exception e){
            e.printStackTrace();
        }
        return json;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProductGroupId() {
        return productGroupId;
    }

    public void setProductGroupId(int productGroupId) {
        this.productGroupId = productGroupId;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public int getMaterialType() {
        return materialType;
    }

    public void setMaterialType(int materialType) {
        this.materialType = materialType;
    }

    public String getMaterialFilepath() {
        return materialFilepath;
    }

    public void setMaterialFilepath(String materialFilepath) {
        this.materialFilepath = materialFilepath;
    }

    public String getMaterialFileuri() {
        return materialFileuri;
    }

    public void setMaterialFileuri(String materialFileuri) {
        this.materialFileuri = materialFileuri;
    }

    public int getLocationX() {
        return locationX;
    }

    public void setLocationX(int locationX) {
        this.locationX = locationX;
    }

    public int getLocationY() {
        return locationY;
    }

    public void setLocationY(int locationY) {
        this.locationY = locationY;
    }

    public int getScaleRate() {
        return scaleRate;
    }

    public void setScaleRate(int scaleRate) {
        this.scaleRate = scaleRate;
    }

    public int getHideState() {
        return hideState;
    }

    public void setHideState(int hideState) {
        this.hideState = hideState;
    }

    public int getMaterialShowState() {
        return materialShowState;
    }

    public void setMaterialShowState(int materialShowState) {
        this.materialShowState = materialShowState;
    }

    public int getMaterialKeyShowtime() {
        return materialKeyShowtime;
    }

    public void setMaterialKeyShowtime(int materialKeyShowtime) {
        this.materialKeyShowtime = materialKeyShowtime;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getAnswerTxt() {
        return answerTxt;
    }

    public void setAnswerTxt(String answerTxt) {
        this.answerTxt = answerTxt;
    }

    public int getAnswerType() {
        return answerType;
    }

    public void setAnswerType(int answerType) {
        this.answerType = answerType;
    }

    public int getAnswerState() {
        return answerState;
    }

    public void setAnswerState(int answerState) {
        this.answerState = answerState;
    }

    public String getAnswerAudio() {
        return answerAudio;
    }

    public void setAnswerAudio(String answerAudio) {
        this.answerAudio = answerAudio;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getDeleteStatus() {
        return deleteStatus;
    }

    public void setDeleteStatus(int deleteStatus) {
        this.deleteStatus = deleteStatus;
    }

    public boolean isViewStatus() {
        return viewStatus;
    }

    public void setViewStatus(boolean viewStatus) {
        this.viewStatus = viewStatus;
    }

    public ImageView getImageView() {
        return imageView;
    }

    public void setImageView(ImageView imageView) {
        this.imageView = imageView;
    }

    public VideoView getVideoView() {
        return videoView;
    }

    public void setVideoView(VideoView videoView) {
        this.videoView = videoView;
    }
}
